An image processing method is known in which, regarding, for example, image data, the image data is classified (clustered) into one of a plurality of classes and a process corresponding to the class is performed.
According to such an image processing method, for example, when clustering is to be performed on the basis of the activity of image data, image data having high activity, such as image data with large changes, and image data having low activity, such as flat image data, can be clustered into different classes. As a result, image processing appropriate for image data having high activity and image data having low activity can be performed thereon.
According to the above-described image processing, image processing suitable for image data of a class can be performed for each image data clustered for each class. Therefore, theoretically, the larger the number of classes, the more appropriate the processing that can be performed on image data clustered into each class.
However, when the number of classes becomes huge, the number of patterns of image processing performed according to the class becomes huge, and the device becomes larger. That is, for example, in the manner described above, when clustering is performed on the basis of activity, by providing the same number of classes as the number of values that the activity can take, image processing appropriate for the activity can be performed on the image data of each activity. However, for example, when N difference values of the adjacent pixels of pixels arranged in the horizontal direction are used as the activity, if the difference value is of K bits, the total number of classes becomes huge, namely, (2K)N.
For this reason, clustering is performed by using some kind of a compression process, such as ADRC (Adaptive Dynamic Range Coding).
More specifically, in the clustering using ADRC, N difference values, such as those described above, as data used for clustering (hereinafter referred to as a “class tap”), are subjected to an ADRC process, and a class is determined according to the ADRC code obtained thereby.
In K-bit ADRC, for example, the maximum value MAX and the minimum value MIN of the values of the data forming the class taps are detected, DR=MAX−MIN is assumed to be a local dynamic range of a set, and based on this dynamic range DR, the values of the data forming the class taps are requantized into K bits. That is, the minimum value MIN is subtracted from the value of the data forming the class taps, and the subtracted value is divided (quantized) by DR/2K. A bit sequence such that the K-bit values of the data forming the class taps, obtained in the above-described way, are arranged in a predetermined order is output as an ADRC code. Therefore, when the class taps are subjected to, for example, a 1-bit ADRC process, after the minimum value MIN is subtracted from each piece of data forming the class taps, the data is divided by (maximum value MAX−minimum value MIN)/2, and as a result, each piece of data is formed as 1 bit (binarized). Then, a bit sequence such that the 1-bit data is arranged in a predetermined order is output as an ADRC code.
Here, the clustering can also be performed using, for example, vector quantization, in addition to an ADRC process.
As described above, when clustering is performed using a compression process, the number of classes can be decreased. However, on the contrary, when compared to performing clustering without performing a compression process, detailed clustering, so to speak, cannot be performed, and there are cases in which an appropriate process cannot be performed on image data.
That is, for example, image processing in which the clustering of image data is performed using vector quantization and image data is generated for each class is considered.
In this case, the image data is divided into blocks of a plurality of pixels, and a vector in which, for each block, a plurality of pixels (pixel values) forming the block are components (hereinafter referred to as a “block vector” where appropriate) is formed. Furthermore, the block vector is vector-quantized using a codebook which is determined in advance, and a code (symbol) as the vector quantization result is output as a class code representing the class of the block vector.
Then, image data is generated for each class code. That is, the class code is inversely quantized using the codebook, and the code vector corresponding to the class code is determined. Then, a block in which the components of the code vector are pixels is determined, and the block is arranged at the corresponding position, thereby generating image data.
Here, the inverse vector quantization can be performed using the same codebook as that used in the vector quantization, and also, for example, the inverse vector quantization can be performed using a codebook differing from that used in the vector quantization. That is, the inverse vector quantization can be performed using, for example, a codebook determined using image data having an image quality higher than that of the image data used to generate the codebook used in the vector quantization.
In this case, as a result of the class code being inversely vector quantized, the image data of the image quality corresponding to the image data used to generate the codebook used for the inverse vector quantization, that is, high-quality image data, is determined.
However, with respect to the high-quality image data obtained by inverse vector quantization, if image data for the object of vector quantization is assumed to be low-quality image data, in the above-described image processing, block vectors among the block vectors of the low-quality image data that are vector quantized into the same class code are all inversely vector quantized into the same class code, that is, the block vector of the same high-quality image data. In other words, the code vector determined in the inverse vector quantization has a so-called quantization error. Therefore, although the image data generated in the above-described image processing may be said to be of high quality, the image quality is deteriorated by an amount corresponding to the quantization error from the point of view of the image quality of the high-quality image data used for generating the codebook for the inverse vector quantization.